const fs = require("fs");
const path = require("path");
const dotenv = require("dotenv");
dotenv.config();
console.log("hostPort", process.env.APP_HOST + ":" + process.env.APP_PORT);

// 通过绝对路径 拼接
// const PRIVATE_KEY=fs.readFileSync(path.resolve(__dirname,'./keys/private.key'))
const PRIVATE_KEY = fs.readFileSync("src/app/keys/private.key");
// const PUBLIC_KEY=fs.readFileSync(path.resolve(__dirname,'./keys/public.key'))
const PUBLIC_KEY = fs.readFileSync("src/app/keys/public.key");

module.exports = {
  APP_PORT,
  APP_HOST,
  MYSQL_HOST,
  MYSQL_PORT,
  MYSQL_DATABASE,
  MYSQL_USER,
  MYSQL_PASSWORD,
} = process.env;

// 要写在后面，不然会被覆盖
module.exports.PRIVATE_KEY = PRIVATE_KEY;
module.exports.PUBLIC_KEY = PUBLIC_KEY;
